package com.szholly.plug.arcgis.entity;

import java.util.HashMap;

import org.springframework.stereotype.Component;

import com.szholly.utils.spring.SpringBeanFactory;
import com.szholly.data.general.*;
import com.szholly.data.general.metadata.IBaseTable;

/**
 * 地图层次信息表
 */
@Component("GisConfigLods")
public class GisConfigLodsTable extends InterceptorTableBase  implements IBaseTable{

	public final static String TABLE_NAME = "GIS_CONFIG_LODS";
	
	/**
	 * single ref
	 */
	public static GisConfigLodsTable getSingleRef() {
		return (GisConfigLodsTable) SpringBeanFactory.getBean("GisConfigLods");
	}

	@Override
	public String getMetadataTableName() {
		return TABLE_NAME;
	}

	@Override
	public String getMetadataTableAliasName() {
		return "地图层次信息表";
	}

	private HashMap<String, Field> fields;

	@Override
	protected HashMap<String, Field> fields() {
		if (fields == null) {
			fields = new HashMap<String, Field>();

			Field itemField = new Field();
			itemField.setFieldName(RowBase.FIELD_GUID);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(1);
			itemField.setFieldAliasName("GUID");
			itemField.setIsKey(true);
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(RowBase.FIELD_VERSION);
			itemField.setDataType(GlobalDataType.Int32);
			itemField.setFieldID(2);
			itemField.setFieldAliasName("VERSION");
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(GisConfigLodsRow.FIELD_DResolution);
			itemField.setDataType(GlobalDataType.Double);
			itemField.setFieldID(5);
			itemField.setFieldAliasName("精度");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(GisConfigLodsRow.FIELD_ILevel);
			itemField.setDataType(GlobalDataType.Int32);
			itemField.setFieldID(6);
			itemField.setFieldAliasName("地图级别");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(GisConfigLodsRow.FIELD_DScale);
			itemField.setDataType(GlobalDataType.Double);
			itemField.setFieldID(7);
			itemField.setFieldAliasName("比例尺");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(GisConfigLodsRow.FIELD_STitle);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(8);
			itemField.setFieldAliasName("显示名称");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(GisConfigLodsRow.FIELD_SConfigid);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(9);
			itemField.setFieldAliasName("配置ID");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
		}
		return fields;
	}

	@Override
	public String getTableGroup() {
		return "地图";
	}
}